/**
 * 获取病例表格头
 */
export const getPersonMap = function () {
    return [
        {
            dataIndex: "name",
            key: "name",
            title: "姓名",
        },
        {
            dataIndex: "idNumber",
            key: "idNumber",
            title: "身份证",
        },
        {
            dataIndex: "phone",
            key: "phone",
            title: "手机号",
        },
        {
            dataIndex: "msg",
            key: "msg",
            title: "备注",
        },
    ]
}

export const getLogsMap = function () {
    return [
        {
            dataIndex: "name",
            key: "name",
            title: "分析任务名称",
        },
        {
            dataIndex: "date",
            key: "date",
            title: "任务创建时间",
        },
        {
            dataIndex: "count",
            key: "count",
            title: "病例数量",
            sorter: (c, d) => c.count - d.count,
        },
        {
            dataIndex: "userName",
            key: "userName",
            title: "创建人"
        },
    ]
}

export const getSHLogsMap = function () {
    return [
        {
            dataIndex: "uuid",
            key: "uuid",
            title: "病例编号",
            sorter: (a, b) => a.uuid - b.uuid,
        },
        {
            dataIndex: "idNumber",
            key: "idNumber",
            title: "调查对象身份证",
        },
        {
            dataIndex: "operationInfoList[0].personName",
            key: "userPhone",
            title: "调查人员",
        },
        {
            title: "状态",
            key: "state",
            dataIndex: "state",
            scopedSlots: { customRender: 'states' },
            filters: [
                { text: '待审核', value: '待审核', },
                { text: '审核中', value: '审核中', },
                { text: '已审核', value: '已审核', },
            ],
            filterMultiple: true,
            onFilter: (value, record) => record.states.indexOf(value) === 0,
        },
    ]
}


export const getANLogsMap = function () {
    return [
        {
            dataIndex: "uuid",
            key: "uuid",
            title: "病例编号",
            sorter: (a, b) => a.uuid - b.uuid,
        },
        {
            dataIndex: "idNumber",
            key: "idNumber",
            title: "调查对象身份证",
        },
        {
            dataIndex: "template",
            key: "template",
            title: "个案类型",
        },
    ]
}

export function getUserMap() {
    return [
        {
            dataIndex: "username",
            key: "username",
            title: "姓名",
        },
        {
            dataIndex: "phone",
            key: "phone",
            title: "手机号",
        },
        {
            title: '角色',
            key: "roleSet",
            scopedSlots: { customRender: "roleSet" },
        },
    ]
}


export function getRoleMap() {
    return [
        {
            dataIndex: "name",
            key: "name",
            title: "角色名",
            width: 100
        },
        {
            title: '权限列表',
            key: "authoritySet",
            scopedSlots: { customRender: "authoritySet" },
        },
    ]
}

export function getAuditMap() {
    return [
        {
            dataIndex: "userPhone",
            key: "userPhone",
            title: "操作人员",
        },
        {
            dataIndex: "ip",
            key: "ip",
            title: "IP地址",
        },
        {
            dataIndex: "uri",
            key: "uri",
            title: "接口",
        },
        {
            dataIndex: "timestamp",
            key: "timestamp",
            title: "时间戳",
        },
        {
            dataIndex: "date",
            key: "date",
            title: "时间",
        },
    ]
}